#include <stdio.h>
const int N = 40;
typedef struct node {
    double num;
    char op;
    int flag;
}node;

typedef struct stack {
    node ths;
}stack;

double js(double a, double b, char c)
{
    switch (c) {
    case '+': return a + b;
    case '-': return a - b;
    case '*': return a * b;
    case '/': return a / b;
    }
}

int main()
{
    node a[N];
    int cnt = 0;
    char ch, ch1;
    stack st1[N];
    int top1 = 0;

    while ((ch = getchar()) && ch != '\n') {
        if (ch == ' ') {
            continue;
        }
        double sum = 0;
        int flag = 1;
        if (ch == '-') {
            flag = -1;
            ch1 = ch;
            ch = getchar();
        }
        if (ch >= '0' && ch <= '9') {
            sum = ch - '0';
            while ((ch = getchar()) && ch != '\n' && ch != ' ') {
                if (ch >= '0' && ch <= '9') {
                    sum = sum * 10 + ch - '0';
                }
                else {
                    break;
                }
            }
            double x = 0.1;
            if (ch == '.') {
                while ((ch = getchar()) && ch != '\n' && ch != ' ') {
                    if (ch >= '0' && ch <= '9') {
                        sum = sum + (ch - '0') * x;
                        x *= 0.1;
                    }
                    else {
                        break;
                    }
                }
            }
            a[cnt].flag = 1;
            a[cnt++].num = flag * sum;
        }
        else {
            a[cnt].flag = 0;
            a[cnt].op = ch;
            if (flag == -1) {
                a[cnt].op = ch1;
            }
            cnt++;
        }
        if (ch == '\n') {
            break;
        }
    }
    node t;
    for (int i = cnt - 1; i >= 0; i--) {
        if (a[i].flag == 1) {
            st1[top1++].ths = a[i];
        }
        else {
            double num1 = st1[--top1].ths.num;
            double num2 = st1[--top1].ths.num;
            t.flag = 1;
            if (a[i].op == '/' && num2 == 0) {
                printf("ERROR\n");
                return 0;
            }
            t.num = js(num1, num2, a[i].op);
            st1[top1++].ths = t;
        }
    }

    printf("%.1f\n", st1[top1 - 1].ths.num);
    return 0;
}